package com.lagou.work.workthree;

public class PhoneTest {

    public static void main(String[] args) {
        PhoneCard phoneCard = new PhoneCard(CardTypeEnum.BIG_CARD.name(),"13333333333","test","123456",100,100,100);
        phoneCard.show();
        System.out.println("------------------------");
        PricingPac pricingPac = new PhonePac(100,100,19);
        pricingPac.show();
        System.out.println("------------------------");
        if (pricingPac instanceof PhonePac){
            ((PhonePac) pricingPac).callPhone(39,phoneCard);
        }else {
            System.out.println("这个类不能转换为PhonePac类！！！");
        }
        System.out.println("------------------------");
        PricingPac pricingPac1 = new InternetAccessPac(1000,19);
        pricingPac1.show();
        System.out.println("------------------------");
        if (pricingPac1 instanceof InternetAccessPac){
            ((InternetAccessPac) pricingPac1).online(30,phoneCard);
        }else {
            System.out.println("这个类不能转换为InternetAccessPac类！！！");
        }
    }
}
